package com.iweb.db;

import java.sql.Connection;
import java.sql.DriverManager;

/**
 * 数据库连接
 */
public class XdDataSource {

    private static String driverClass = "oracle.jdbc.driver.OracleDriver";
    private static String url = "jdbc:oracle:thin:@192.168.100.101:1521:orcl";
    private static String user = "iweb233";
    private static String pwd = "123456";

    public static Connection getConnection() {
        Connection connection = null;
        try {
            // 加载驱动
            Class.forName(driverClass);
            // 设置参数,获取连接对象
            connection = DriverManager.getConnection(url, user, pwd);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return connection;
    }

}
